/**
 * @copyright Copyright (c) 2025 
 * CSG Digital Grid Technology (Guangdong) Co., Ltd.
 * @author xxxcsg
 */

#ifndef __POWERBIND_UTILITY_H_
#define __POWERBIND_UTILITY_H_

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <errno.h> 
#include <limits.h>

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))

#define DIGEST_MAX_LEN 32
#define BUFFER_LEN 64

void to_hex(char* s, int len, char* hex_str);

int hash_file(const char* filepath, char* hash_hex);

int read_file(const char* filepath, char** data);

#endif
